package com.app.params.activity

import android.os.Bundle
import android.view.View
import android.widget.Toast
import com.app.params.R
import com.app.params.utlis.Constans
import com.app.params.utlis.Sharedpreference
import com.blankj.utilcode.util.AppUtils
import common.BaseActivity
import kotlinx.android.synthetic.main.activity_clear_seting.*

class ClearSeting : BaseActivity() {
    lateinit var share: Sharedpreference
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_clear_seting)
        setTitle_text("清理设置")
        share = Sharedpreference.getinitstance()
        packageNameSetting.setText(share.getstring(Constans.packName))
        pathSetting.setText(share.getstring(Constans.pathName))
    }

    fun dian(v: View) {
        var packgeString = packageNameSetting.text.toString()
        var pathString = pathSetting.text.toString()
        if (packgeString != "") {
            share.setstring(Constans.packName, packgeString)
        } else {
            Toast.makeText(this, "请输入程序包名", Toast.LENGTH_SHORT).show()
            return
        }
        if (pathString != "") {
            share.setstring(Constans.pathName, pathString)
        } else {
            Toast.makeText(this, "请输入目录路径", Toast.LENGTH_SHORT).show()
            return
        }
        finish()
    }
}
